{extend name="base" /}
{block name="body"}
<div class="layui-row layui-col-space15">
    <!--访问量-->
    <style>
        .layuiadmin-big-font{font-size:30px;color:#666;line-height:36px;padding:5px 0 10px;overflow:hidden;text-overflow:ellipsis;word-break:break-all;white-space:nowrap}
        .x-admin-carousel,.layui-carousel,.x-admin-carousel>[carousel-item]>* {background-color:#fff}
        .x-admin-backlog .x-admin-backlog-body {
    display:block;
    padding:10px 15px;
    background-color:#f8f8f8;
    color:#999;
    border-radius:2px;
    transition:all .3s;
    -webkit-transition:all .3s
}
.x-admin-backlog-body h3 {
    padding-bottom:10px;
    font-size:12px
}
.x-admin-backlog-body p cite {
    font-style:normal;
    font-size:30px;
    font-weight:300;
    color:#169f1d;
}
.x-admin-backlog-body:hover {
    background-color:#CFCFCF;
    color:#888
}
    </style>
    {if !empty($index)}
    <div class="layui-col-md12">
        <div class="layui-card">
            <div class="layui-card-header">快捷方式</div>
            <div class="layui-card-body">
                <div class="index-nav layui-clear">
                    {foreach name="index" item="v"}
                    <a href="{$Request.root.true}/{$v.url}"><i class="{$v.icon}"></i> {$v.name}</a>
                    {/foreach}
                    <a href=""><i class="fa fa-street-view"></i> 今日访问</a>
                </div>
            </div>
        </div>
    </div>
    {/if}
    <div class="layui-col-md12">
        <div class="layui-card">
            <div class="layui-card-header">访问统计</div>
            <div class="layui-card-body">
                <div class="layui-carousel x-admin-carousel x-admin-backlog" lay-anim="" lay-indicator="inside" lay-arrow="none" style="width: 100%; height: 90px;">
                    <div carousel-item="">
                        <ul class="layui-row layui-col-space10 layui-this">
                            <li class="layui-col-xs2">
                                <a href="javascript:;" class="x-admin-backlog-body">
                                    <h3>今日IP（PC/M）</h3>
                                    <p><cite>{$data.today_pcip} / {$data.today_mip}</cite></p>
                                </a>
                            </li>
                            <li class="layui-col-xs2">
                                <a href="javascript:;" class="x-admin-backlog-body">
                                    <h3>今日PV（PC/M）</h3>
                                    <p>
                                        <cite>{$data.today_pcpv} / {$data.today_mpv}</cite></p>
                                </a>
                            </li>
                            <li class="layui-col-xs2">
                                <a href="javascript:;" class="x-admin-backlog-body">
                                    <h3>本月IP（PC/M）</h3>
                                    <p><cite>{$data.month_pcip} / {$data.month_mip}</cite></p>
                                </a>
                            </li>
                            <li class="layui-col-xs2">
                                <a href="javascript:;" class="x-admin-backlog-body">
                                    <h3>本月PV（PC/M）</h3>
                                    <p>
                                        <cite>{$data.month_pcpv} / {$data.month_mpv}</cite></p>
                                </a>
                            </li>
                            <li class="layui-col-xs2">
                                <a href="javascript:;" class="x-admin-backlog-body">
                                    <h3>今年IP（PC/M）</h3>
                                    <p><cite>{$data.year_pcip} / {$data.year_mip}</cite></p>
                                </a>
                            </li>
                            <li class="layui-col-xs2">
                                <a href="javascript:;" class="x-admin-backlog-body">
                                    <h3>今年PV（PC/M）</h3>
                                    <p>
                                        <cite>{$data.year_pcpv} / {$data.year_mpv}</cite></p>
                                </a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-col-md12">
        <div class="layui-card">
            <div class="layui-card-header">近30天访问数据</div>
            <div class="layui-card-body">
                <div id="container" style="height: 500px;"></div>
            </div>
        </div>
    </div>
    {if !empty($server)}
    <div class="layui-col-md12">
        <div class="layui-card">
            <div class="layui-card-header">服务器信息</div>
            <div class="layui-card-body">
                <table class="layui-table">
                    <tbody>
                        <tr>
                            <td style="width:50%;">服务器操作系统：{$server.os}</td>
                            <td style="width:50%;">服务器软件：{$server.sapi}</td>
                        </tr>
                        <tr>
                            <td>PHP版本：{$server.version}</td>
                            <td>MySQL版本：{$server.mysql.0.version}</td>
                        </tr> 
                        <tr>
                            <td>根目录：{$server.root}</td>
                            <td>最大执行时间：{$server.max_execution_time}</td>
                        </tr>
                        <tr>
                            <td>文件上传限制：{$server.upload_max_filesize}</td>
                            <td>允许内存大小：{$server.memory_limit}</td>
                        </tr>
                        <tr>
                            <td>服务器时间：{$server.date}</td>
                            <td>技术支持：<a href="http://www.liunuo.net" target="_blank">六诺科技</a></td>
                        </tr>
                        <tr>
                            <td colspan="2">更新通知：<script type="text/javascript" src="http://open.ennn.cn/update/cms.js"></script></td> 
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    {/if}
</div>
{/block}
{block name="js"}
<script src="/static/js/echarts.common.min.js"></script>
<script type="text/javascript">
    var dom = document.getElementById("container");
    var myChart = echarts.init(dom);
    var app = {};
    option = null;
    option = {
        title: {
            left: 'center'
        },
        tooltip : {
            trigger: 'axis',
            axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        xAxis: {
            type: 'category',
            name: '日期',
            splitLine: {show: true},
            data: [
            <?php foreach ($array as $r) {?>
                '{$r}日',
            <?php }?>]
        },
        yAxis: {
            type: 'value'
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        series: [
            {
                name: 'IP',
                data: [<?php foreach ($ip as $r) {?>
                        {$r},
                        <?php }?>],
                type: 'line',
                label:{
                    normal:{
                        show:true,
                        position:'top',
                        textStyle: {
                            color: '#333',
                            fontSize: 18
                        }
                    }
                }
            },
            {
                name: 'PV',
                data: [<?php foreach ($pv as $r) {?>
                        {$r},
                        <?php }?>],
                type: 'line',
                label:{
                    normal:{
                        show:true,
                        position:'top',
                        textStyle: {
                            color: '#000',
                            fontSize: 18
                        }
                    }
                }
            }
        ]
    };
    ;
    if (option && typeof option === "object") {
        myChart.setOption(option, true);
    }
</script>
{/block}